package mop.model.user;

import java.util.List;

import mop.exception.IllegalDescriptionException;
import mop.exception.IllegalDuplicationException;
import mop.model.AbstractModel;
import mop.model.AbstractModelWithDescription;
import mop.model.DataBase;
import mop.model.ModelInterface;
import mop.model.task.field.Field;
import mop.model.task.tasktype.TaskTypeInterface;

/**
 * UserType class
 * @author adriaan
 * 
 * @invar Description is valid.
 *  	  @see AbstractDescriptionModel
 */
public class UserType extends AbstractModelWithDescription implements UserTypeInterface
{

	/**
	 * Constructor for UserType
	 * 
	 * @param db the database voor UserTypes
	 * @param description the description of the usertype
	 * 
	 * @effect	(Tries to) set the description.
	 * 			| setDescription(description)
	 * 
	 * @effect gets added to the database db
	 * 
	 * @throws  IllegalDescriptionException
	 * 			Thrown when the Project description is invalid.
	 * 
	 * @throws IllegalDuplicationException 
	 * 		| user might be duplicate
	 */
	public UserType(DataBase<UserType> db,String id,String description) throws IllegalDescriptionException,IllegalDuplicationException
	{
		super(description);
		db.add(this);
                this.id = id;
	}
	
	/***************************************************************************
	 * 						Model interface
	 ***************************************************************************/

        private String id;

	/**
	 * @see ModelInterface#getId()
	 */
	public String getId() 
	{
		return this.id;
	}
	
	/**
	 * get a reference to the interface
	 * @return this
	 */
	public UserTypeInterface getInterface()
	{
		return this;
	}

}
